<?php
	$con = mysql_connect("localhost","root","");
	if (!$con) {
		die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("ciu196", $con);
	
	// Select the room the user is in
	$sql = "SELECT roomID FROM StudentsInRooms where studentID = '$studentID';";
	$res = mysql_query($sql,$con);
	if(!$res) {
		die('Error: ' . mysql_error());
	}
	
	$num_rows = mysql_num_rows($res);
	$room = mysql_fetch_row($res);
	
	// User does not exist 
	if($num_rows == 0) {
		echo "Does not exist in any room";
	} else {
		echo $room[0];
	}
	
	mysql_close($con);	
?>